package cn.humaohua.study.yanmo_design_pattern.ch14.v2;

import java.util.Collection;
import java.util.Iterator;

public class Client {
    public static void main(String[] args) {
        PayManager payManager = new PayManager();

        payManager.calcPay();
        Collection payList = payManager.getPayList();
        Iterator it = payList.iterator();
        System.out.println("集团工资列表：");
        while (it.hasNext()) {
            PayModel pm = (PayModel) it.next();
            System.out.println(pm);
        }

        SalaryManager salaryManager = new SalaryManager();
        salaryManager.calcSalary();
        PayModel[] pms = salaryManager.getPays();
        System.out.println("新公司公司列表：");
        for (PayModel pm : pms)
            System.out.println(pm);
    }
}
